#ifndef UNITTEST_H
#define UNITTEST_H

#include "GlobalConfig.h"
#include <wx/string.h>
#include <vector>
#include <map>

#ifdef UNIT_TEST

class OauthData;
class Oauth;
class wxString;
class CLogin;
class CHttpReq;
class CUser;
class wxFFile;
class XMLIntegrityValidator;

class UnitTest_OAuth
{
    public:
        UnitTest_OAuth();
        virtual ~UnitTest_OAuth();

        static UnitTest_OAuth& GetInstance();
        void initOauth();
        wxString getBaseString();
        wxString signRequest();
        wxString HMAC_SHA1();
        wxString getReqTokenHeader();
        wxString getNonce();
        wxString getTimestamp();
        void extractHttpParams();

    private:
        OauthData*                mReqTokenData;
        Oauth*                      mOauth;
        CHttpReq*                  mHttpReq;
};

class UnitTest_Login
{
    public:
        UnitTest_Login();
        virtual ~UnitTest_Login();

        static UnitTest_Login& GetInstance();

        void getRequestToken();
        void getAccessToken(const wxString& _PIN);
    private:
        CLogin* m_pLogin;

        void InitLogin();
        void DestroyLogin();
};

class UnitTest_XMLValidator
{
    public:
        UnitTest_XMLValidator();
        virtual ~UnitTest_XMLValidator();
        bool readXML(const wxString& fileName);
        bool parseXML();
        wxString sampleXML_Test();
        wxString validateXML_Test();
        wxString XMLRefFind_Test();
        wxString XMLErrorCorrection_Test();
        std::map<wxString, std::vector<size_t> >& getStats();
        //std::map<wxString, std::vector<size_t> >& getErrorList();
        std::vector<std::map<wxString, wxString> >& getUserData();

        static UnitTest_XMLValidator& GetInstance();

    private:
        CUser*  mpCUser;
        wxFFile*  mpFile;
        wxString mFileContent;
        XMLIntegrityValidator* mpValidator;
};

#endif // UNIT_TEST

#endif // UNITTEST_H
